﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace NapCardOnline.Models
{
    public partial class Commission
    {
        /// <summary>
        /// Gets the commission by service id and commission level id.
        /// </summary>
        /// <param name="serviceId">The service id.</param>
        /// <param name="commissionLevelId">The commission level id.</param>
        /// <returns>
        /// The Commission object
        /// </returns>
        public static Commission GetCommissionByServiceIdAndCommissionLevelId(int serviceId, int commissionLevelId)
        {
            using (var db = new NapCardOnlineEntities())
            {
                return db.Commissions.FirstOrDefault(c => c.FK_ServiceID == serviceId && c.FK_CommissionLevelID == commissionLevelId);
            }
        }
    }
}